<template>
  <div>
    <div class="homeCompent" style="">
      <img class="bgImg" v-if="!canEvaluatedDepartment && !seeResult" src="../../assets/kaifang.jpg" alt="">
      <router-link to="/departentPage">
        <div v-if="canEvaluatedDepartment == true " class="unitLink">
          <p>
            <span>点击进入集中评价</span>
          </p>
        </div>
      </router-link>
      <router-link to="/departenName">
        <div v-if="seeResult == true  " class="departenResult">
          <p>
            <span>点击查看集中评价结果</span>
          </p>
        </div>
      </router-link>
    </div>
  </div>
</template>
<script>
export default {
  name: "departentPage",
  data() {
    return {
      canEvaluatedDepartment: false, //是否评价过
      seeResult: false //是否可以看集体结果权限
    };
  },
  created() {
    this.filterInfo();
  },
  methods: {
    //是否显示评价按钮 和 查看评价结果权限接口
    filterInfo() {
      this.axios('api/evaluate/filterInfo').then(response => {
        this.canEvaluatedDepartment = response.data.canEvaluatedDepartment;
        this.seeResult = response.data.seeResult;
        console.log("是否可以集体评价",response.data.canEvaluatedDepartment);
        console.log("是否可以看集体结果权限",response.data.seeResult);
      });
    }
  }
};
</script>
